/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vn.ikame.android.utils;

import android.app.Activity;
import android.content.SharedPreferences;

/**
 * 
 * @author KienVN
 */
public class CStore {
	SharedPreferences prefs;
	private SharedPreferences.Editor editor;
	private int cateID;
	private boolean isInstall;

	public CStore(Activity activity) {
		prefs = activity.getPreferences(android.content.Context.MODE_PRIVATE);
		this.editor = prefs.edit();
		LoadData();
	}

	private void LoadData() {
		cateID = prefs.getInt("cateID", 0);
		isInstall = prefs.getBoolean("isInstall", false);
	}

	private void Save() {
		editor.putInt("cateID", cateID);
		editor.commit();
	}

	public boolean isInstall() {
		return isInstall;
	}

	public void setInstall(boolean isInstall) {
		this.isInstall = isInstall;
		editor.putBoolean("isInstall", isInstall);
		editor.commit();
	}
	
	public int getCateID() {
		return cateID;
	}

	public void setCateID(int cateID) {
		this.cateID = cateID;
		Save();
	}


}
